package com.go8.goods.service;

import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.go8.goods.mapper.AttributeMapper;
import com.go8.goods.pojo.Attribute;

@Service
public class AttributeServiceImpl implements AttributeService {
	@Autowired
	private AttributeMapper attributeMapper;
	
	@Override
	public void addAttribute(Attribute attr) {
		Date now = new Date();
		attr.setGmtCreate(now);
		attr.setGmtModified(now);
		attributeMapper.insert(attr);
	}

	@Override
	public List<Attribute> getAttrAndValue(Attribute attr) {
		return attributeMapper.selectAttributeAndValue(attr);
	}

}
